﻿@using System.Linq
@model System.Collections.Generic.IEnumerable<DotNet.Model.BaseModuleEntity>
@{
    Layout = null;
}
<style type="text/css">
    #list_ModuleList_Module
    {
        padding: 10px;
    }
    #list_ModuleList_Module dl
    {
        width: 100%;
    }
    #list_ModuleList_Module dt
    {
        font-weight: bold;
        margin-top: 10px;
        float: none;
        font-size: 14px;
    }
    #list_ModuleList_Module dd
    {
        padding-left: 20px;
        float: none;
        width: auto;
    }
    #list_ModuleList_Module ul
    {
    }
    #list_ModuleList_Module li
    {
        float: left;
        padding: 2px 5px;
        width: 150px;
        display: block;
        overflow: hidden;
        line-height: 20px;
    }
    #list_ModuleList_Module a
    {
        text-indent: none;
        line-height: 20px;
        text-align: center;
        display: block;
    }
    #list_ModuleList_Module a:hover
    {
        color: #f33;
    }
    #list_ModuleList_Module img
    {
        width: 50px;
        border: 0;
    }
</style>
<script type="text/javascript">
    $(function () {
        $("#list_ModuleList_Module a").click(function (e) {
            var parentA = $("#mainContent_Home_Index .fast_bar .a_icon:eq(@ViewBag.pIndex)");
            parentA.attr("url", $(this).attr("url"));
            parentA.attr("rel", $(this).attr("rel"));
            parentA.attr("moduleId", $(this).attr("moduleId"));
            parentA.find("img").attr("src", $(this).attr("imgurl"));
            parentA.find("span").text($(this).find("span").text());
            parentA.attr("target", "_move");
            parentA.closest("li").removeClass("li_add");
            if (parentA.nextAll(".btn_bar").size() == 0)
                parentA.after('<div class="btn_bar"><a class="btn_edit"  href="javascript:void(0);">替换</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn_del" href="javascript:void(0);">删除</a></div>');

            parentA.next(".btn_bar").show();
            $.pdialog.closeCurrent();
            e.preventDefault();
        });
    });
</script>
<div id="list_ModuleList_Module" class="pageFormContent" layouth="60">
    <dl>
        @foreach (var module in Model.Where(m => m.ParentId.ToString() == ViewBag.PID))
        {
           <dt>@module.FullName</dt>
           foreach (var modules in Model.Where(m => m.ParentId == module.Id))
           {
            <dt style="padding-left: 20px; color: #666;">@modules.FullName</dt>
            <dd>
                <ul>
                    @foreach (var entity in Model.Where(m => m.ParentId == modules.Id))
                    {
                        <li><a href="javascript:void(0);" url="@entity.NavigateUrl" moduleId="@entity.Id" imgurl="@entity.ImageUrl" rel="@entity.Code">
                            <img src="@entity.ImageUrl"/><br />
                            <span>@entity.FullName</span></a> </li>
                    }
                </ul>
            </dd>
           }
        }
    </dl>
</div>
<div class="formBar">
    <ul>
        <li>
            <button type="button" class="btn btn-default btn-sm close">关闭</button>
        </li>
    </ul>
</div>
